#pragma once
#include<iostream>
#include<string.h>
using namespace std;
namespace xyx
{
	class string
	{
	public:
		string(const char* str = "")
		{
			_size = strlen(str);
			_capacity = _size;
			_str = new char[_capacity + 1];
			strcpy(_str, str);
		}

		typedef char* iterator;
		iterator begin()
		{
			return _str;
		}
		iterator end()
		{
			return _str + _size;
		}

		~string()
		{
			delete[] _str;
			_str = nullptr;
			_size = 0;
			_capacity = 0;
		}
		const char* c_str()
		{
			return _str;
		}
	private:
		
		size_t _size;
		size_t _capacity;
		char* _str;
	};
}

